import Vue from 'vue'
import Router from 'vue-router'
import crm from './crm'
import srm from './srm'
import cfg from './sys'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/login',
    name: 'login',
    component: () => import('@/views')
  }, {
    path: '/',
    name: '/',
    component: () => import('@/components/Layout'),
    redirect: '/home',
    children: [{
      path: 'home',
      name: 'home',
      component: () => import('@/views/Home')
    }]
  }, {
    path: '/401',
    name: '401',
    component: () => import('@/views/401')
  }, {
    path: '/404',
    name: '404',
    component: () => import('@/views/404')
  },
  srm,
  crm,
  cfg,
  {
    path: '*',
    redirect: '/404'
  }]
})
